﻿using HZU.ZP.Data.Interfaces;
using HZU.ZP.Data.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HZU.ZP.Data.Impl
{
    public class AdminDao : IAdminDao
    {
        private EFCoreDbContext _context;

        public AdminDao(EFCoreDbContext context)
        {
            _context = context;
        }
        public Admin Get(string name, string password)
        {
            return _context.Admins.FirstOrDefault(e => e.Name == name && e.Password == password);
        }

        public Admin Get(string name)
        {
            return _context.Admins.FirstOrDefault(e => e.Name == name);
        }
    }
}
